home *** CD-ROM | disk | FTP | other *** search
/ boe.pres.k12.wv.us / boe.pres.k12.wv.us.zip / boe.pres.k12.wv.us / Utilities / Xerox Workcentre 5335 / Windows Scan / 32-bit_x86 / Russian / cpsimage.cab / data / xps / xps2xip.elf < prev    next >
Text File  |  2009-03-16  |  1KB  |  47 lines

  1. /*
  2. ** First pass at making a script to read XPS and write XPS
  3. **
  4. ** Ash Nafarieh 05/15/2006
  5. */
  6.  
  7.  
  8. // Give me a PDF file to convert
  9. #load "xps/xmetWriteXPS.proc";        /* xps support procs */
  10.  
  11. // let's get what we need to process this
  12. #import "documentio.ucm";
  13. LoadClasses (filename: "xeng");
  14.  
  15. IMPORT STRING infile;
  16. IMPORT STRING outfile;
  17.  
  18. // Test for proper parameters
  19. if ( !infile || !outfile) {
  20.   print "Usage: \"xipe xps2xip.elf -im infile:s infile outfile:s outfile\" ";
  21.   end;
  22.   }
  23.  
  24. // Get a document reader
  25. DOCUMENTREADER dr = CreateDocumentReader (filename: infile);
  26.  
  27. // Verbose output
  28. INTEGER pgCnt = dr.getPageCount ();
  29. print infile + " has " + pgCnt + " pages";
  30.  
  31. XIPIMAGE img = dr.getPage(pgnum:1);
  32. print "Segmented image had " + img.nlayers + " layers";
  33.  
  34. print "WriteXPSOpen";
  35. WriteXPSOpen(filename: outfile);
  36.  
  37. print "WriteXPSPage";
  38. WriteXPSPage(filename: outfile, img: img, pgNum: 1);
  39.  
  40. print "WriteXPSClose";
  41. WriteXPSClose(filename: outfile);
  42.  
  43. // Release resources
  44. dr.release();
  45.  
  46. print TimeCheck();
  47.